package com.itany.controller;

import com.itany.pojo.ManagerUser;
import com.itany.service.IndexService;
import com.itany.vo.Menu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.HashSet;

/**
 * Author：sl
 * Date：2019-09-28 下午1:48
 * Description：<描述>
 */
@RequestMapping("/index")
@Controller
public class IndexController {

    @Autowired
    IndexService indexService;


    @RequestMapping("showMenu")
    @ResponseBody
    public HashSet<Menu> showMenu(HttpSession session) {

        ManagerUser managerUser = (ManagerUser) session.getAttribute("managerUser");

        HashSet<Menu> hashSet = indexService.showMenu(managerUser.getId());

        return hashSet;

    }
}
